Polyimide resins, which have excellent heat resistance and mechanical properties, are widely used in the production of interlayer insulation films and surface protection films for semiconductor elements of electronic devices. To improve the productivity and accuracy in forming those films, various studies have been conducted to impart a good photosensitivity to the polyimide resins, i.e. photosensitive polyimide resins. For example, negative photosensitive polyimide resins have been in practical use. Those are prepared by introducing a photo-crosslinkable group into a polyimide precursor through an ester linkage or an ionic bond. In respect to positive ones, JP-A-5(1993)-5996 and JP-A-2000-98601 disclose compositions that comprise a polyimide precursor and an orthoquinonediazide compound. However, the negative ones have problems in resolution and in forming films, and the positive ones in heat resistance, electrical insulating properties and adhesive properties with respect to substrates. Although there are many other patent applications in this field, they are not a complete solution for meeting the requirements that come from the trends of semiconductor elements toward high integration and small thickness. Further, the current resin compositions still have drawbacks; for example, the curing thereof causes thickness reduction (volume shrinkage) and involves multistage baking and atmosphere control. With such problems, it has been pointed out that these resin compositions are not beneficial to use in industrial production.